function rules() {
    return {
        ip: [
            {
                validator: (rule, value, callback) => {
                    let reg = /^\d{2,3}\.\d{2,3}.\d{2,3}.\d{2,3}$/g;
                    let flag = reg.test(value)
                    if (value == "") {
                        callback("ip不能为空")
                    } else {
                        flag ? callback():callback(new Error("请输入正确的ip地址"))
                    }
                },
                triggle: "blur",
                required: true
            }
        ]
    }
}
export default rules